package com.xiaowen.controller;

import com.xiaowen.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;

/**
 * Created by 15c on 2017/6/2.
 */
@Controller
public class HelloController {
    @Autowired
    UserService userService;
    @RequestMapping(value ="/hello",method = RequestMethod.GET)
    public String helloWord(Model model){
        userService.showUser(1);
        model.addAttribute("name",userService.showUser(2).getUserPassword());
        return "hello";

    }
}
